package com.sugar.subscribe.course.module.business.dal.mysql.venue;

import java.util.*;

import com.sugar.subscribe.course.framework.common.pojo.PageResult;
import com.sugar.subscribe.course.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.subscribe.course.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.subscribe.course.module.business.dal.dataobject.venue.VenueDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.subscribe.course.module.business.controller.admin.venue.vo.*;

/**
 * 场地 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface VenueMapper extends BaseMapperX<VenueDO> {

    default PageResult<VenueDO> selectPage(VenuePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<VenueDO>()
                .likeIfPresent(VenueDO::getName, reqVO.getName())
                .likeIfPresent(VenueDO::getCityName, reqVO.getCityName())
                .betweenIfPresent(VenueDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(VenueDO::getId));
    }

}